<template>
  <div>
    {{ this.$store.state.request.request_data }}
    <div class="view-style-title">派单设置</div>
    <el-form
      :model="sendform"
      label-position="left"
      label-width="120px"
      class="demo-form-inline"
    >
      <el-form-item label="接单响应时间">
        <el-input v-model="sendform.respondSeconds" v-blur style="width:320px" placeholder="请输入内容" />
      </el-form-item>
      <el-form-item label="派单">
        <el-radio-group v-model="sendform.workType" size="mini">
          <el-radio-button label="1">企业内部</el-radio-button>
          <el-radio-button label="2">电力承包</el-radio-button>
          <el-radio-button label="3">临时雇佣</el-radio-button>
        </el-radio-group>
      </el-form-item>
      <div v-if="sendform.workType == 1">
        <indoor />
      </div>
      <div v-if="sendform.workType == 2">
        <contract />
      </div>
      <div v-if="sendform.workType == 3">
        <temporary />
      </div>
    </el-form>
    <el-button type="primary" @click="$store.commit('request/SET_STEPS', 1)">上一步</el-button>
    <el-button style="margin-top: 12px;" type="primary" @click="next('ruleForm')">下一步</el-button>
  </div>
</template>
<script>
const sendform = {
  respondSeconds: '',
  workType: 1
}
import indoor from './components/indoor'
import contract from './components/contract'
import temporary from './components/temporary'
export default {
  components: {
    indoor,
    contract,
    temporary
  },
  data() {
    return {
      sendform: Object.assign({}, sendform),
      tableData: []
    }
  },
  methods: {
    next() {
      this.$store.commit('request/SET_STEPS', 3)
      this.$store.commit('request/REQ_FORM', this.sendform)
    }
  }
}
</script>
